home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ABUSESRC.ZIP / AbuseSrc / macabuse / inc / client.hpp < prev    next >
C/C++ Source or Header  |  1997-05-20  |  1KB  |  49 lines

  1. #ifndef __CLIENT_HPP_
  2. #define __CLIENT_HPP_
  3. /*
  4.  
  5.   Client duties :
  6.  
  7.        - Get local inputs
  8.        - Send current inputs
  9.  
  10.        - read server commands until 
  11.        - process commands
  12.        - ability to detach from server
  13.        - ability to "talk" with a local server
  14.          through global local_server
  15.        and functions local_server->insert_received_packet(pk);
  16.                      local_server->get_output_packet(pk);
  17.  
  18.  
  19. */
  20. #include "macs.hpp"
  21. #include "packet.hpp"
  22. class view;
  23.  
  24. class game_client
  25. {
  26.   int process_command(uchar cmd, view *player, packet &pk);
  27.   int need_to_read_views;
  28. public :
  29.   int cnum;
  30.   game_client(int client_number);
  31.   void request_entry();                   // asks server for entry into the game
  32.   void wait_entry();                      // wait for signal from server so we can download level
  33.   void entry_continue();                  // server needs ack before continue from above
  34.   void get_local_inputs(packet &pk);      // writes inputs to packet as commands
  35.   void send_local_request(packet &pk);    // sends commands to server
  36.  
  37.   void read_server_commands(packet &pk);  // reads everybodies commands
  38.   void process_packet(packet &pk);
  39.   void quit_server();
  40.   void read_views();
  41. } ;
  42.  
  43. extern game_client *local_client;
  44.  
  45. #endif
  46.  
  47.  
  48.  
  49.